import time
import torch
import socket as _socket
from src.networks import ExpTripletNetwork as _use_net

_hostname = str(_socket.gethostname())
_time = time.strftime('%m-%d %H:%M:%S', time.localtime())

_name = 'test'
USE_NET = _use_net

# Dataset
DATASET_PROC_METHOD_TRAIN = 'Rescale224'
DATASET_PROC_METHOD_VAL = 'Rescale224'
#

# Embedding Pretrianed
USE_PRETRAINED_WORD_EMBEDDING = False

if 'macdeMacBook-Pro-2.local' == _hostname:
    base_path = '/Users/hzy/dataset/polyvore/'
elif 'dlcs302-2' == _hostname:
    base_path = '/home/hzy/datasets/polyvore/'
    EMBED_PRETRAINED_PATH = '/home/hzy/datasets/word2vec/GoogleNews-vectors-negative300.bin'
else:
    base_path = '/home/dl/datasets/polyvore/'
    EMBED_PRETRAINED_PATH = '/home/dl/datasets/word2vec/GoogleNews-vectors-negative300.bin'

# Outfit Preprocess
OUTFIT_ITEM_PAD_NUM = 8
OUTFIT_NAME_PAD_NUM = 10
#

# Word
WORD_EMBED_SIZE = 300  # 这个是和之前word2vec保持一致的
MAX_VOCAB_SIZE = 300
###

# Image
IMAGE_EMBED_SIZE = 300

# EMBED
EMBED_MARGIN = 0.2

# WEIGHT
WEIGHT_NORM_TEXT = 0.00
WEIGHT_NORM_IMAGE = 0.01
WEIGHT_IMAGE_TEXT = 0.
WEIGHT_OUTFIT_CENTER = 1.
WEIGHT_INTER_PRODUCT = 1.

# TRAIN
NUM_EPOCH = 20
LEARNING_RATE = 0.0001
LEARNING_RATE_DECAY = 0.9
BATCH_SIZE = 7
SAVE_EVERY_STEPS = 1000
SAVE_EVERY_EPOCHS = 1

# VAL
VAL_WHILE_TRAIN = True
VAL_FASHION_COMP_FILE = "fashion_compatibility_small.txt"  # 先用小的测
VAL_FITB_FILE = "fill_in_blank_test_small.json"
VAL_BATCH_SIZE = 8
VAL_EVERY_STEPS = 10000
VAL_EVERY_EPOCHS = 1

# auto
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
TRAIN_DIR = 'runs/%s/' % _name + _time
VAL_DIR = 'runs/%s/' % _name + _time
MODEL_NAME = '%s' % _name
#############
